The present invention relates to a numerical control unit which controls a machine tool to form a workpiece as commanded by input instructions.
A conventional numerical control unit will now be described in accordance with FIGS. 60-71.
FIG. 60 shows a block diagram of the main section of an NC (numerical control) unit, in which 1 is an NC unit, and 2 is an external input/output unit connected to the NC unit 1. The input/output unit 2 is for sending and receiving data used by the NC unit 1. The NC unit 1 comprises a processor (CPU) 10, ROM 14 and RAM 15 for storing a control program, a display unit (CRT) 19 and its controller (GDC) 18, a video RAM (VRAM) 17 for storing the data to be displayed, a keyboard (KEY) 21 and its controller 20, a nonvolatile memory (RAM for battery backup) 16 for storing various parameters and offset data, and axis control sections 11 for controlling each axis (X-axis, Y-axis and Z-axis) of a machine for machining a workpiece, a PMC unit 12 for transferring data to or from external units (a large-current board and console on a machine) by executing the predetermined sequential processing, and I/O unit 13, and an input/output controller 22 for transferring data to or from the external input/output unit 2. Each of elements 10, 11, 12, 14, 15, 16, 17, 18, 20 and 22 is connected by a busline 4.
FIG. 61 shows a block diagram of various pieces of data which are stored in the nonvolatile RAM 16 of the NC unit 1. Tool data in the RAM 16 is comprised of elements 91, 92 and 93 and is set off by a dotted line in FIG. 61. This tool data is data associated with a tool (not illustrated) mounted on a machine (not illustrated) to be controlled by the NC unit. Specifically, tool shape data 91 is the data related to the shape of the tool, tool compensation data 92 is the data relating to the nose-radius compensation value of a tool, and tool offset data 93 is the data for setting the offset value showing the mounting position of a tool. Cutting condition data 94 involves data for setting a value used for an automatic determination of the cutting condition.
The dotted line in FIG. 61 surrounding elements 95 and 96 relates to machining program data and it is there that information is stored concerning the specific programs used by the NC unit to execute the numerical control which results in the machining of a workpiece by the tool. Machining program data consists of an area 95 for storing machining programs described by EIA language and an area 96 is for storing machining programs described by an automatic program.
Further, arrangement data 97 is included in the memory 16, and this data includes type-of-chuck data used for each machining operation and also includes data for a Z offset showing the end position of a workpiece. Parameter area 98 includes various parameters used for the NC unit 1.
Of all the data stored in the RAM 16 described above in the conventional NC unit, only the EIA machining program 95 is stored in the form of character codes (ASCII). The other data is stored in other various forms, such as binary form.
FIG. 62 shows an operation board of an NC unit, which consists of a CRT 19 and a keyboard 21. The user operates the various keys on the keyboard 21 in order to input various data to the NC unit. The CRT 19 is used to display information to the operator. FIGS. 63-66 show various pieces of data displayed on the CRT 19. Specifically, FIG. 63 shows a "POSITION" screen showing the information for the present position, or the like, of a tool. FIG. 64 is a "TOOL DATA" screen showing offset data for a tool. FIG. 65 is an "NOSE-R" screen showing data for the nose radius of a tool. Finally, FIG. 66 is a "PROGRAM FILE" screen showing the information for the machining programs stored in the NC unit.
FIG. 67 is a diagram for explaining how data stored in the nonvolatile memory 16 is displayed on the CRT 19. In FIG. 67, it is assumed that numerical values in parentheses indicate rows and columns displayed on the CRT 19. That is, "-(5, 3)-" indicates the data displayed on the fifth row in the third column of the CRT 19.
In general, each piece of data is stored in the nonvolatile memory 16 of the NC unit 1 in a specific area according to the type of data. That is, one type of data, double-precision real-number type data (TYPE-L), is collected and stored in one part of the memory 16 as shown in the bottom portion of FIG. 67. The numeral 28 represents this portion of the memory 16, specifically, the portion that includes TYPE-L data. As another example, another type of data, double-precision integral-number type data (TYPE-N) is also collected and stored in another part of the memory as shown by the numeral 29 in the bottom part of FIG. 67.
Therefore, in the conventional NC unit, each piece of data is usually stored in the nonvolatile memory 16 according to its data type and therefore data is not stored in a manner corresponding to the order in which it will be displayed on the CRT 19. Therefore, when data is to be displayed on the CRT 19, it must be rearranged first after it is read out of the memory 16 so that it may be arranged on the CRT 19 in order according to the numbers shown in parentheses in the top part of FIG. 67. This rearranging operation takes time and thus limits the efficiency of the conventional NC unit.
The data for an NC unit normally includes the following types: double-precision real-number type: 8-byte data capable of handling 15-digit real numbers; real-number type: 4-byte data capable of handling 7-digit real numbers; double-precision integral-number type: 4-byte data capable of handling 8-digit integers; and integral-number type: 2-byte data capable of handling 4-digit integers. Thus, with the conventional NC unit, much rearranging of data needs to be performed in order to display the data on the CRT 19.
Data is conventionally transferred to or from an NC unit by an interface such as an RS232C interface. For the EIA machining program 95 discussed earlier, data is generally inputted or outputted in the form of character codes, since character codes can easily be inputted or outputted. Although the machining program 95, as well as compensation value data 92 or the parameter data 98 of the NC unit 1, is capable of being inputted and outputted to and from the NC unit 1 in the form of character codes, other data has conventionally not been input/output in the form of character codes.
Recently, an NC unit has been developed in which automatic ("canned") machining programs 96 (FIG. 61) are increasingly used, these programs being stored in the non-volatile RAM 16. FIG. 68 shows a machining diagram to be worked on according to the automatic machining program. FIG. 69 shows the automatic program for machining the workpiece shown in FIG. 68. The internal data of the automatic program shown in FIG. 69 has a special data structure, which does not involve the use of character codes. Therefore, to input or output the automatic program data 96, the data stored in the NC unit 1 is directly inputted or outputted in a form which is not the character code form.
Therefore, a problem existed in the prior art in that only certain types of data were inputted to or outputted from the NC unit 1 in the form of character codes which are easily handled by the external input/output unit 2.
The manner in which the restricted class of data is input/output to/from the NC unit 1 in the form of character codes will now be described. For example, the tool compensation value data 92 can be inputted or outputted in the form of character codes as shown below, (similarly to the EIA machining program 95).
______________________________________ G01L11 P.sub.-- X.sub.-- Z.sub.-- Y.sub.-- R.sub.-- Q; ______________________________________
where,
P: is the offset number PA1 X.sub.-- : is the X-axis offset value PA1 Z.sub.-- : is the Z-axis offset value PA1 Y.sub.-- : is the Y-axis Offset value PA1 R.sub.-- : is the nose radius compensation value PA1 Q.sub.-- : is the assumed tip position PA1 G10L50: parameter input mode PA1 (G11 is the parameter input mode cancel) PA1 N.sub.-- : is the parameter number PA1 P.sub.-- : is the axis number (for axis-type parameter) PA1 R.sub.-- : is the parameter value. PA1 the moving distance of the X-axis PA1 Y: the moving distance of the Y-axis PA1 Z: the moving distance of the Z-axis PA1 F: the cutting (feed) speed PA1 (a) receives data to be output from the numerical control unit to the external input/output unit and converts the data into character code data, and PA1 (b) receives data input from said external input/output unit to said numerical control unit and converts the data from character code data into a machine code. PA1 specifying means for specifying certain ones of said values to be described by variables instead of by said actual numerical values; PA1 defining means for defining a variable; and PA1 replacing means for replacing the certain ones of said values specified by said specifying means with variables defined using said defining means. PA1 input means for inputting memo data corresponding to tolerance limits of said operation data; and PA1 display means for displaying said memo data. PA1 machining controlling means for controlling a machining operation based on the program data stored in said buffer means; PA1 wherein said program data is input from said input/output apparatus in a form so that it can be directly stored in said buffer means.
The tool compensation value 92 can be set or corrected by the command G10.
An example will now be given of how the parameter data 98 can be inputted or outputted in the form of character codes.
______________________________________ G10L50; N.sub.-- R.sub.-- ; N.sub.-- P.sub.-- R.sub.-- ; . . . N.sub.-- R.sub.-- ; G11; ______________________________________
where,
In conventional NC units, a DNC function was used in order to transfer data between the NC unit 1 and the external input/output unit 2. However, according to the DNC function, it is necessary to develop exclusive software for the NC unit 1 and external input/output unit 2 because data is inputted or outputted by using an exclusive protocol, such a protocol not involving the character code format.
Now, the conventional method of processing data using a machining program will be described. FIG. 70 is a block diagram showing the outline of the processing by the program of the conventional NC unit 1. In FIG. 70, numeral 2 is the above-described external input/output unit which can be a controller for a floppy disk, IC card, and cassette tape or unit for communication with a computer system. Numeral 22 is an input/output controller in the NC unit 1, 23 is a machining program analyzing section, 24 is a data buffer, 25 is a machine controlling section, 26 is a servo controlling section and 27 represents servomotors.
A machining program is inputted from the external input/output unit 2 to the NC unit 1. The machining program may temporarily be stored in the memory 16 of the NC unit 1 or is directly sent to the analyzing section 23.
The purpose of the machining program analyzing section 23 is to analyze the machining program and check for errors in the machining program and to send the analysis results to the data buffer 24. The data buffer 24 temporarily stores the analysis results of the machining program. The machining controlling section 25 sequentially fetches the analysis results from the data buffer 24 to control a machine according to the analysis results. In the machine controlling section 25, an interpolation operation is executed, and the interpolation results are sent to the servo controlling section 26 where the servomotor 27 of each axis is servo controlled. In this way, the NC unit 1 can properly control a machine tool to machine a workpiece according to the machining program which has been input to the NC unit 1 by the input/output unit 2.
When the NC control unit is to machine a die for use in molding, a machining program may be generated, for example, by an off-line CAM (computer aided manufacturing) system or the like. In this case, measurement data involving a large number of commands of very short moving distances is generated because the machining program consists of data made by estimating a complex tool locus with microline segments. Therefore, in this instance, a great volume of data is transferred to the NC unit 1 by the input/output CAM system 2. The NC unit processing speed cannot match the speed at which the great volume of data is entering the NC unit.
Specifically, the program analyzing section 23 must first perform a specific analysis of the data before the analysis results can be sent to the data buffer 24. In the meantime, the machine controlling section 25 has sequentially processed all of the analysis results stored in the buffer 24 and the buffer is empty. When the buffer becomes empty, the machine controlling section has no more data to fetch from the buffer and thus the machining operation temporarily stops. This affects a workpiece to be machined and also the machining time increases. Therefore, a method of transferring binary-format data as shown in FIG. 71 is proposed in which tool moving distances of 4 msec and 8 msec are expressed by binary data to execute high-speed processing according to the moving-distance data for the specified number of axes. The number of axes to be commanded is specified by parameters.
According to the conventional method of FIG. 71, the data for one block consists of (2*N+1) bytes. N is the number of axes to be controlled. The moving distance of each axis is commanded with 2 bytes. A negative moving distance is commanded with the complement of 2. A check byte is obtained by adding the (2*N) bytes other than the check byte and discarding the overflow of 8 bits or more out of the total value.
Also, another method of realizing high-speed processing by limiting the format of a machining program inputted from an external unit 2 has been proposed in which a high-speed block can be commanded in the machining program. Only the following factors can be specified in this block:
All pieces of data in this block are processed through linear interpolation (G01). A command format is specified as follows:
______________________________________ . . . G05P01; --start of high-speed machining X.sub.-- Y.sub.-- Z.sub.-- ; . . . G05P00; --end of high-speed machining . . ______________________________________
According to these conventional methods, however, the number of factors which can be specified in the blocks are limited (see FIG. 71). Further, the complicated process of linear interpolation must be carried out.
Another problem which existed in the prior art NC units will now be discussed. Some NC units 1 have the function of allowing data relating to a future machining operation to be input and set during actual machining. This is known as a background function since the operator is allowed to input and set data, for example, to be used in a future machining operation, while present actual machining is being carried out in the foreground. Certain types of data, for example, tool compensation values and parameter values which affect the machining currently executed, however, cannot be corrected according to the background function. This is because it is dangerous to correct the data used for machining, such as parameters and tool information, during actual machining. Therefore, in the prior art, data to be corrected is restricted.
However, when it is necessary to correct internal data which relates to a future process, the data is conventionally corrected after the present machining is completed. Thus, a problem exists in that a subsequent machining operation cannot be executed during correction of data and thus downtime increases.
To solve this problem, a method involving two memories is proposed in Japanese Utility Model Laid-open No. 1-127002. For this method, however, double memory area is necessary. Because recent NC units require a lot of data, this method greatly decreases the serviceability ratio of memory, causing the cost to greatly increase.
Also, in prior art NC units, it is impossible to compare data values before and after correction. For parameters, a method of storing data before it is corrected and displaying data values from the latest one before correction is proposed in Japanese Utility Model Laid-open No. 1-172133. However, this method only displays and stores the data before correction. Thus, direct comparison between the old and new values is not possible.
Because the machining program for an NC unit 1 is generally large, it is handled as a file. For file processing, a conventional method of recovering the original version of an erased or updated file is proposed in Japanese Patent Laid-open No. 3-116248. For this conventional method, however, the system for managing the file must greatly be remodeled in order to be able to recover the original file.
In many situations workpieces are to be machined which are approximately the same shape but which vary slightly as to the length of certain measurements. In the prior art it was necessary to correct the machining program for each different workpiece, or to separately enter various machining programs, one for each workpiece. The machining programs are almost the same. Therefore, time and memory is wasted.
With respect to shape data, there is a known parametric-shape defining method for defining the shape data by using variables. For this method, however, it is frequently necessary to define data by using an exclusive language. Therefore, the parametric shape cannot be defined unless the operator masters this exclusive language.
Further, in conventional NC units, when data was displayed on the CRT 19, the data was only displayed by using numerals and abbreviations. For example, abbreviations such as "X, Z, C, R, r and P" were used. A problem exists in that the operator may not understand what the abbreviations stand for unless he looks up the definitions of the abbreviations in a manual, or unless he is intensely familiar with the use of the NC unit.
Moreover, in conventional NC units, it cannot be detected whether abnormal data (i.e., a value which is greatly removed from the normal range of values for that piece of data) is input.